
<h1><%= 'Listing ' + @selected_person.name + '\'s locations'  %></h1>

<%= form_tag(relation_path(@selected_person), :method => "PUT") do %>
  <% unless @all_locations.empty? %>
    <% @all_locations.each do |loc| %>
        <%= label_tag(loc.id, loc.name) %>
        <%= check_box_tag "selected[]", loc.id, (true if @my_locations_array.include?(loc.id)) %>
        <br>
    <% end %>
  <% end %>
  <%= submit_tag("Edit") %>
<% end %>
<%= link_to('Back', '/relation') %>